-- multi_random_bonus
-- create by zhuangsl
-- 道具： 随机获得多种奖励

return {
    apply = function(source, target, classId, value)
        -- 随机数量
        local rand = DungeonM.getRandSeed("property_multi_bonus");
        local min = value["min"];
        local max = value["max"];
        local count = min + rand % (max - min + 1);

        -- 抽取列表
        local list = value["list"];
        local listCount = #list;

        for index = 1, count do
            rand = 1 + DungeonM.getRandSeed("property_multi_bonus") % listCount;
            if type(list[rand]) == 'number' then
                -- 目前只支持物品奖励
                BonusM.doBonus({1, list[rand], 1}, "property_multi_bonus");
            end
        end
    end,
};
